'''
Created on 29/03/2011

@author: Eran_Z

IO
'''

#Input
def getWeightingAlg():
    """Gets the name of the desired weighting algorithm."""
    return "Mutual Information"

def getScoringAlg():
    """Gets the name of the desired scoring algorithm."""
    return "Normalized Mutual Information"

def getContext():
    """Gets the Context, as a list (of strings)."""
    return ["Aladdin", "Cinderella", "Snow White"]

def getUnfilteredWorld():
    """Gets the unfiltered World, as a list (of strings)."""
    return ["the Exorcist", "a", "Sex and the city", "Toy Story", "b"]

def getSeen():
    """Gets a list of seen movies, will not be recommended"""
    return ["b", "a"]

def getBlacklist():
    """Gets a list of blacklisted movies, will not be recommended"""
    return ["a"]

def getFiltered():
    """Gets a list of movies that will not be recommended"""
    res = getSeen()
    res.extend(getBlacklist())
    return res

def getWorld():
    """Gets the filtered World, as a list (of strings)."""
    filtered = getFiltered()
    unfilteredWorld = getUnfilteredWorld()
    return [movie for movie in unfilteredWorld if movie not in filtered]  


#Output
def output(context, weights, world, scores):
    """Outputs the information retrieved to the user."""
    print "CONTEXT:"
    for i in range(len(world)):
        print context[i] + " ( " + str(weights[i]) + " )"
    print ""
    print "WORLD:"
    for i in range(len(world)):
        print world[i] + " :  " + str(scores[i])

